//
//  TwERPJsonAgent.h
//  TwERP
//
//  Created by Xiangyang Li on 12-7-14.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface TwERPJsonAgent : NSObject

+ (NSDictionary *)  getVehicleByCphm:(NSString *)cphm;   //按车牌查找车辆
+ (NSDictionary *)  getGongdanById:(int)gdId;   

+ (NSArray *)  getGongdanListByCphm:(NSString *)cphm;   //按车牌查找维修历史工单
+ (NSArray *)  getPartListByKeyword:(NSString *)keyword;  //根据关键字返回零件定义

+ (int) idOfEntityType:(NSString *)className;       //提供新纪录的id
+ (NSString *) gdNo;                        
+ (NSString *)getCpHeader;              //车牌字头
+ (NSArray *)getCategoryOfGd; //工单维修分类
+ (NSArray *)getTgxmUrl; // 促销推广项目
+ (NSArray *)getJpxmUrl; //精品展示项目

+ (NSArray *)getAllCpHeaders;              //车牌字头
+ (NSArray *)getLabourListByKeyword:(NSString *)keyword; //查询工时项目
+ (NSArray *)getLabourListByCategoryId:(int)categoryId; //浏览工时项目

+ (NSString *) commitEntity:(NSDictionary *)entity;

+ (NSDictionary *) loginUser:(NSString *)loginName WithPassword:(NSString *)password;

+ (NSString *)postFileToServer:(NSURL *)localUrl;
+ (NSString *)postFileToServer2:(NSURL *)localUrl;

+ (void)getFileFromServer:(NSURL *)localUrl;
+ (NSString *)printGjd:(int)entityId;
+ (NSString *)printJsd:(int)entityId;

+ (void) setHost:(NSString *)hostOrIP;
+ (void) setUserId:(int) idOfUser;
+ (int) getUserId;

+ (void) initReachability;
+ (BOOL) isServerReachable;

+ (NSString *)getBasicUrl;


/*
 There are 5 method which directly access the server via net,
 and marked with comment '//net'. They are:
 1. (void)getFileFromServer:(NSURL *) localUrl
 2. (NSString*)postFileToServer:(NSURL *) localUrl
 3. (NSString*)postJson:(NSDictionary *) entityData ToURL: (NSString *)urlString
 4. (id)excuteQuery:(NSString *)query
 5. (id)excuteQuery0:(NSString *)query
 */
@end
